% 手动定义第一条线的坐标
iterations1 = [1, 40, 80, 120, 160, 200, 240, 280, 320, 360, ...
               400, 440, 480, 520, 560, 600, 640, 680, 720, 760, ...
               800, 840, 880, 920, 960, 1000];
average_access_rates1 = [2.8, 2.8, 2.76, 2.77, 2.76, 2.8,2.81, 2.82, 2.8, 2.87, ...
                         2.9, 2.88, 2.85, 2.84, 2.82, 2.8, 2.777, 2.72, 2.7, 2.67, ...
                         2.66, 2.70, 2.72, 2.75, 2.81, 2.87];
 
% 手动定义第二条线的坐标
iterations2 = iterations1; % 使用相同的迭代次数
average_access_rates2 = [2.94, 2.90, 2.97, 2.99, 2.95, 3.1, 2.95, 3.26, 3.40, 3.58, ...
                         3.82, 3.99, 4.24, 4.52, 4.48, 4.39, 4.520, 4.59, 4.59, 4.55, ...
                         4.57, 4.55, 4.57, 4.55, 4.56, 4.55];
 
% 手动定义第三条线的坐标
iterations3 = iterations1; % 使用相同的迭代次数
average_access_rates3 = [3.15, 3.17, 3.2, 3.3, 3.25, 3.22, 3.66, 3.981, 4.79, 4.80, ...
                         4.84, 4.84, 4.8, 4.79, 4.77, 4.8, 4.77, 5.22, 5.13, 5.221, ...
                         5.11, 5.22, 5.21, 5.22, 5.23, 5.23];
 
% 绘制图形
figure;
plot(iterations1, average_access_rates1, '-o','LineWidth', 2,  'DisplayName', 'DQN');
hold on; % 保持当前图形
plot(iterations2, average_access_rates2, '-s', 'LineWidth', 2,'DisplayName', 'D3QN');
plot(iterations3, average_access_rates3, '-d','LineWidth', 2,  'DisplayName', 'FL-D3QN');
hold off;
 
% 添加标签和图例
xlabel('迭代次数');
ylabel('平均奖励值');


legend('show'); % 显示图例